This application is based on Japanese Patent Application No. 9-298738 filed in Japan, the content of which is hereby incorporated by reference.
1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method. More particularly, the present invention relates to an apparatus and method for processing M gradation image data of a target pixel to obtain N gradation image data of the target pixel by using an error diffusion method, where N is less than M.
2. Description of the Related Art
An image processing apparatus that allows an input multi-value gradation level image to be reproduced in a binary gradation level image using an error diffusion method is known. The error diffusion method used in such types of image processing apparatuses diffuses the difference between the density of a target pixel of a read out image and the display density (binarization error) to predetermined peripheral pixels using a predetermined error diffusion matrix. In other words, binarization error of a predetermined neighborhood pixel is diffused to the density of a target pixel at a predetermined rate and then weight applied to calculate the display density. The error diffusion method will be described hereinafter.
FIG. 5 is a block diagram showing a related error diffusion method. When the density data of each pixel forming a multivalue gradation level input image is:
Ixy (0xe2x89xa6Ixyxe2x89xa61),
and the density data of each pixel forming a binarized image output corresponding to Ixy is:
Bxy (Bxy=0 or 1),
then the binarization error Exy is calculated by the following equation (1) if correction by the weighted mean error Eavexy that will be described afterwards is not taken into account.
Exy=Ixyxe2x88x92Bxyxe2x80x83xe2x80x83(1)
In the error diffusion method, the binarization error is averaged to become smaller by diffusing the binarization error to the peripheral pixels. FIG. 5 shows an error weighting filter 15 employed in diffusing the binarization error of a neighborhood pixel to the target pixel to be processed. In this figure, xe2x80x9c*xe2x80x9d designates the pixel of interest to be processed (particularly called target pixel). With respect to pixel data Ixy of this target pixel, binarization error Exy of each of the peripheral pixels that are already processed and located within the dotted line in error weighting filter 15 is error-diffused by respective weighting coefficients (1/16, 2/16, 3/16 shown in FIG. 5) to correct the density data of target pixel Ixy. Therefore, in practice, binarization error Exy of the previous equation (1) is calculated on the basis of data Ixe2x80x2xy which is a corrected version of target pixel data Ixy. It is appreciated from FIG. 5 that an error feedback loop is formed for error diffusion. When the data correction value of target pixel data Ixy is Eavexy, corrected data Ixe2x80x2xy is calculated by the following equation (2).
Ixe2x80x2xy=Ixy+Eavexyxe2x80x83xe2x80x83(2)
Here, correction value Eavexy is the weighted mean error with respect to the input target pixel data Ixy, and is calculated by the following equation (3) where ki, j is the weighting coefficient of error weighting filter 15. Here, i is the matrix size in the main scanning direction, for example i=5, and j is the matrix size in the subscanning direction, for example j=3.
Eavexy=xcexa3(Ki, jxc3x97Ei, j)xe2x80x83xe2x80x83(3)
In FIG. 5, xe2x80x9c26xe2x80x9d designates an adder that adds the density data of the target pixel with the weighted mean error Eavexy of the peripheral error. Adder 26 outputs corrected data Ixe2x80x2xy according to equation (2) to a comparator 10 for binarization and to a subtractor 11 for binarization error calculation.
Comparator 10 compares corrected data Ixe2x80x2xy obtained by equation (2) with a predetermined threshold value Th. Binarization is carried out according to the result of the comparison. Thus, density data Bxy of the pixel forming a binarization image is defined as shown in the following equation (4).
Bxy=1 (Ixe2x80x2xyxe2x89xa7Th) or 0 (Ixe2x80x2xy less than Th)xe2x80x83xe2x80x83(4)
The result of comparator 10 is also applied to a selector 12. Selector 12 selects a reference value Bxe2x80x2xy that is used in calculating binarization error Exy as in the following equation (5) according to the result from comparator 10. The selected value is provided to subtractor 11.
Bxe2x80x2xy=HB (Bxy=1) or LB (Bxy=0)xe2x80x83xe2x80x83(5)
In the above equation (5), HB (High reference value) and LB (Low reference value) are applied corresponding to the upper limit value and the lower limit value of the dynamic range of the output pixel density. For example, HB=1 and LB=0.
In subtractor 11, binarization error Exy is calculated by the following equation (6) with respect to the previous equation (1).
Exy=Ixe2x80x2xyxe2x88x92Bxe2x80x2xyxe2x80x83xe2x80x83(6)
The calculated result of subtractor 11 is stored in an error storage unit 14. The stored data is output to a product sum calculation unit 13 at every input of Ixy to adder 26. Product sum calculation unit 13 sequentially reads out binarization error Ei, j stored in error storage unit 14 according to input data Ixy to multiply a weighting coefficient Ki, j by binarization error Ei, j to calculate weighted mean error Eavexy. The result is provided to adder 26.
The above-described error diffusion method is characterized in its high resolution and gradation. However, weighted mean error Eavexy to be added to one target pixel (the current target pixel) can be calculated only after calculation of binarization error Exy of a pixel immediately preceding the current target pixel (one previous pixel) is completed. Calculation for the current target pixel can be initiated at adder 26 only after the input of the current target pixel and weighted mean error Eavexy of the immediately preceding pixel. Therefore, improvement in the processing speed is desired.
In the present invention, attention is focused on the issue that increase in the processing speed is attributed to the fact that the error feedback loop in FIG. 5 is related to one whole pixel cycle corresponding to the process of one target pixel. An object of the present invention is to provide an image processing apparatus and an image processing method that allows increase in the processing speed without degrading the essential resolution and gradation of the error diffusion method.
According to an aspect of the present invention, an image processing apparatus which processes M gradation image data of a target pixel to obtain N gradation image data of the target pixel (N is less than M) by using an error diffusion method, includes: a first calculator which calculates a first error to be added to the M gradation image data of the target pixel from peripheral pixels of the target pixel, a pixel which is immediately preceding the target pixel being excluded from the peripheral pixels; and an adder which adds the first error calculated by the first calculator to the M gradation image data of the target pixel.
According to another aspect of the present invention, an image processing method for processing M gradation image data of a target pixel to obtain N gradation image data of the target pixel by using an error diffusion method, where N is less than M, includes the steps of: calculating a first error which is to be added to the M gradation image data of the target pixel from peripheral pixels of the target pixel, a pixel which is immediately preceding said target pixel being excluded from the peripheral pixels; and adding the first error to the M gradation image data of the target pixel.
According to the present invention, the N-value gradation reproduction process of a target pixel can be initiated prior to completion of the process of at least an immediately preceding pixel. Therefore, the process can be speeded.
The foregoing and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.